#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
int main()
{
    const char * filename = "./record.txt";
    const char * mylink = "linkCal";
    #if 0
    /*软连接*/
    int ret = symlink(filename,link);
    if(ret == -1)
    {
        perror("symlink error:\n");
        exit(-1);
    }
    printf("create soft link success!\n");
    return 0;
    #endif
    /*硬链接*/
    int ret = link(filename,mylink);
    if(ret == -1)
    {
        perror("link error:\n");
        exit(-1);
    }
    printf("create link success!\n");
    return 0;
}